package vcp.gui.forms;

import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import javax.swing.JButton;

import vcp.gui.components.VCPPanel;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class SaveParkingForm extends VCPPanel {
	private JTextField textCID;
	private JTextField textCarID;
	private JTextField textDate;
	private JComboBox comboHrTo;

	/**
	 * Create the panel.
	 */
	public SaveParkingForm() {
		
		JLabel lblPnum = new JLabel("Parking Number");
		
		JComboBox comboParkinNum = new JComboBox();
		
		JLabel lblCID = new JLabel("Customer ID");
		
		textCID = new JTextField();
		textCID.setColumns(10);
		
		textCarID = new JTextField();
		textCarID.setColumns(10);
		
		JLabel lblCarNum = new JLabel("Car Number");
		
		JLabel lblFromHr = new JLabel("From Hour");
		
		JLabel lblToHr = new JLabel("To Hour");
		
		JLabel lblDate = new JLabel("Date");
		
		JComboBox comboHrFrom = new JComboBox();
		
		comboHrTo = new JComboBox();
		
		textDate = new JTextField();
		textDate.setColumns(10);
		
		JLabel lblDetails = new JLabel("Details");
		
		JTextArea textDetails = new JTextArea();
		
		JButton btnSend = new JButton("send");
		btnSend.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
			}
		});
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addComponent(btnSend)
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(lblCID)
								.addComponent(lblPnum)
								.addComponent(lblCarNum)
								.addComponent(lblDetails))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
								.addGroup(groupLayout.createSequentialGroup()
									.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
										.addComponent(textCarID, Alignment.LEADING)
										.addComponent(textCID, Alignment.LEADING)
										.addComponent(comboParkinNum, Alignment.LEADING, 0, 94, Short.MAX_VALUE))
									.addGap(29)
									.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
										.addComponent(lblFromHr)
										.addComponent(lblToHr)
										.addComponent(lblDate))
									.addGap(18)
									.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
										.addComponent(textDate)
										.addComponent(comboHrTo, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
										.addComponent(comboHrFrom, 0, 97, Short.MAX_VALUE)))
								.addComponent(textDetails, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(comboParkinNum, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblFromHr)
						.addComponent(comboHrFrom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblPnum))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(textCID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblToHr)
						.addComponent(comboHrTo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblCID))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(textCarID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblDate)
						.addComponent(textDate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblCarNum))
					.addGap(29)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(textDetails, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblDetails))
					.addGap(18)
					.addComponent(btnSend)
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}
}
